package v1

import (
	"context"

	v12 "dubbo-go-app/pkg/internal/data/v1"
	"dubbo-go-app/pkg/internal/domain/dto"
)

// service层的管理器
type activityService struct {
	activityFa v12.DataFactory
}
type ActivitySrv interface {
	Delete(ctx context.Context, activityId int64) (*dto.ActivityDTO, error)
}

var _ ActivitySrv = &activityService{}

func newactivityService(fatory *service) *activityService {
	return &activityService{activityFa: fatory.data}
}

func (u *activityService) Delete(ctx context.Context, activityId int64) (*dto.ActivityDTO, error) {
	doDel, err := u.activityFa.Activity().Delete(ctx, activityId)
	if err != nil {
		return nil, err
	}
	return &dto.ActivityDTO{*doDel}, nil
}
